package com.example.factory;

/**
 * Created by Risky57 on 2017/4/28.
 */

public class Store {

    public static final int DISCOUNT_5 = 1;
    public static final int DISCOUNT_8 = 2;
    public static final int DISCOUNT_FULL = 3;

    private SaleBehavior mBehavior;

    public float sell (int count, float price) {
        float money = count * price;
        if (mBehavior == null) return money;
        return mBehavior.sale(money);
    }

    public void setBehavior (SaleBehavior behavior) {
        mBehavior = behavior;
    }
}
